package day8;

import org.junit.Test;

public class HomeWork {
	public static void main(String[] args) {
		String str = "I Love Java";
		System.out.println(str.toLowerCase());
		char[] array = str.toCharArray();
		for (int i = 0; i < array.length; i++) {
			if (array[i] >= 'A' && array[i] <= 'Z') {
				array[i] = (char)(array[i] + 32); 
			}
		}
		String newStr = new String(array);
		System.out.println(newStr);
	}
	
	@Test
	public void test2() {
		String str = "this is my homework! I must finish it!";
		String[] array = str.split(" ");
		int count = 0;
		for (int i = 0; i < array.length; i++) {
			System.out.print(array[i] + " ");
			count++;
		}
		System.out.println("有" + count + "个单词");
	}
}
